<template> 
<div class="app-container">
    <div class="ces-main">



      <el-form
          ref="form"
          :model="FormData"
          :inline="true"
          :rules="rules"
          label-position="right"
          label-width="120px"
        >
        
         
          <el-form-item v-if="this.StepSN == 0||this.StepSN == -999" style="height:5px">

            <el-button
              type="primary"
              size="mini"
              icon="el-icon-tickets"
              @click="confirmData(0)"
              >保存</el-button
            >
          </el-form-item>
          <el-form-item v-if="this.StepSN == 0" style="height:5px">
            <el-button
              type="primary"
              size="mini"
              icon="el-icon-check"
              @click="confirmData(1)"
              >提交</el-button
            >
          </el-form-item>

          <el-form-item v-if="this.StepSN > 0" style="height:5px">
            <el-button
              type="primary"
              size="mini"
              icon="el-icon-tickets"
              @click="confirmData(0)"
              >保存</el-button
            >
          </el-form-item>
          <el-form-item v-if="this.StepSN > 0" style="height:5px">
            <el-button
              type="primary"
              size="mini"
              icon="el-icon-check"
              @click="confirmData(3)"
              >退回上一步</el-button
            >
          </el-form-item>
          <el-form-item v-if="this.StepSN > 0" style="height:5px">
            <el-button
              type="primary"
              size="mini"
              icon="el-icon-check"
              @click="confirmData(2)"
              >审核</el-button
            >
          </el-form-item>
 <el-form-item  style="height:5px">

  <el-button
              type="primary"
              size="mini"
              icon="el-icon-tickets"
               @click="PrintDate()"
              >打印</el-button
            >
          </el-form-item>
           <el-form-item style="height:5px">
            <el-button
              type="primary"
              size="mini"
              icon="el-icon-check"
              @click="handleAdd()"
              >新增</el-button>
    </el-form-item>
              <el-form-item style="height:5px">
            <el-button
              type="primary"
              size="mini"
              icon="el-icon-check"
              @click="handleCopy()"
              >复制</el-button>

          </el-form-item>
          <el-form-item style="height:5px">
            <el-button
              type="primary"
              size="mini"
              icon="el-icon-check"
              @click="handleClose()"
              >关闭</el-button
            >
          </el-form-item>
          
 


        </el-form>    

    <span
          style="
            text-align: center;
            font-size: 20px;
            font-weight: bold;
            display: inline-block;
            width: 100%;
            padding: 3px 0 5px 0;
          "
        >
          <span>生产通知单</span>
          <span style="margin-left: 10px">
            <svg-icon v-if="this.FormData.Status == 0||this.FormData.Status == null" icon-class="Editing" />
            <svg-icon v-if="this.FormData.Status == 1" icon-class="ingAudit" />
            <svg-icon v-if="this.FormData.Status == 2" icon-class="Finish" />
          </span>
        </span>
        
<el-form :model="FormData" label-width="90px" >
       <Mian-Form 
        ref="refFormData"
        labelWidth = '150' 
        :FormData = 'FormData'
         :tableCols = 'FormCols'
          :StepSN = 'StepSN'
        @handleOpen="handleOpen"
        ></Mian-Form >
         <Mian-Form 
        ref="reftableData"
        labelWidth = '150' 
        :FormData = 'tableData'
         :tableCols = 'tableCols'
          :StepSN = 'StepSN'
          billIDName='POrder'
        @handleOpen="handleOpen"
        ></Mian-Form >
      </el-form>


 <el-form
        :inline="true"
        :model="Search"
        class="demo-form-inline"
        size="mini"
      >
      </el-form>
  
 <section class="ces-handle">
      <el-button v-if="this.StepSN == 0"
              type="primary"
              size="mini"
              @click="handleOpen('Sales')"
              icon="el-icon-tickets"
              >添加销售订单</el-button
            >

             <el-button v-if="this.StepSN == 1||this.StepSN == 2||this.StepSN == -1||this.StepSN == -999||this.StepSN == -998"
              type="primary"
              size="mini"
              @click="handleEdit"
              icon="el-icon-tickets"
              >BOM</el-button
            >
             <el-button v-if="this.StepSN == 0||this.StepSN == -999"
              type="primary"
              size="mini"
              @click="handleOpen('Pro')"
              icon="el-icon-tickets"
              >添加工序</el-button
            >

            <!-- <el-button   v-if="this.FormData.Operation != 1"
              type="primary"
              size="mini"
              @click="handleMRPData()"
              icon="el-icon-tickets"
              >订单运算</el-button>       -->
    </section>
        <ces-table 
        size='mini'
         ref="reftableDataPro"
        :isSelection='false'
        :isIndex='true'
        :isSearch='false'
        :isHandle='true'
        :Isfunfail='this.StepSN==0||this.StepSN == -999?true:false'
        :StepSN = this.StepSN
        :WFStepSN='WFStepSN'
        :tableData='FormDataPro' 
        :tableCols='tableColsPro' 
        @handleDelete="delData"
        @handleOpen="handleOpen"
        >
        </ces-table>
        </div>


<el-main style="margin: 1px 10px">
          <span class="blueColor" style="font-size: 15px; font-weight: blod; padding: 10px"
            >审核明细：</span
          >

          <el-timeline :reverse="true" ref="ListLog" :model="ListLog">
            <el-timeline-item
              v-for="(activity, index) in ListLog"
              :key="index"
              :timestamp="activity.CreateDateTime"
            >
              {{ activity.Remark }}
            </el-timeline-item>
          </el-timeline>
        </el-main>


    <el-dialog
              v-if="dialogFormVisible"
              :visible.sync="dialogFormVisible"
              :title="人员资料"
              
              width="800px"
            >
              <el-form :model="name" label-width="80px" label-position="left">
                <v-AccountOpen
                  :ParmType="ParmType"
                  @FunRowAdd="FunrRowsAdd"
                ></v-AccountOpen>
              </el-form>
            </el-dialog>


            <el-dialog
              v-if="dialogCUSTVisible"
              :visible.sync="dialogCUSTVisible"
              :title="客户资料"
              
              width="800px"
            >
              <el-form :model="name" label-width="80px" label-position="left">
                <v-CUSTOpen
                  :ParmType="ParmType"
                  :CUSTtype='1'
                  @FunRowAdd="FunrRowsAdd"
                ></v-CUSTOpen>
              </el-form>
            </el-dialog>


               <el-dialog
              v-if="dialogPRDTVisible"
              :visible.sync="dialogPRDTVisible"
              :title="料品资料"
              
              width="800px"
            >
              <el-form :model="name" label-width="80px" label-position="left">
                <v-PRDTOpen
                  :ParmType="ParmType"
                  :CUSTtype='1'
                  :index="index"
                  @FunRowAdd="FunrRowsAdd"
                  KeyName='PrdNo'
                ></v-PRDTOpen>
              </el-form>
            </el-dialog>


              <el-dialog
              v-if="dialogFormOpen"
              :visible.sync="dialogFormOpen"
              :title="销售订单资料"
              
              width="80%"
            >
              <el-form :model="name" label-width="80px" label-position="left">
                <v-FormOpen
                  :ParmType="ParmType"
                  :FormDataInterID=378
                  :SearchData="SearchData"
                  @FunRowAdd="FunrRowsAdd"
                ></v-FormOpen>
              </el-form>
            </el-dialog>


                   <el-dialog
              v-if="dialogFormOpenPro"
              :visible.sync="dialogFormOpenPro"
              :title="工序资料"
              
              width="80%"
            >
              <el-form :model="name" label-width="80px" label-position="left">
                <v-FormOpen1
                  :ParmType="ParmType"
                  :FormDataInterID=1576
                  :SearchData="SearchDataPro"
                   KeyName='ID'
                  @FunRowAdd="FunrRowsAdd"
                ></v-FormOpen1>
              </el-form>
            </el-dialog>


</div>
</template>

<script>


//引入组件

import cesTable from "../Common//table.vue";
import SearchForm from "../Common//Search.vue";
import MianForm from "../Common//form.vue";
import { PrintDate } from "@/api/Print";
import { funDownload,GetTableColsData,GetFormColsData } from "@/api/Common";
import {UpdateForm,DeleteRow,MRPData} from '@/api/MesPo/PoOrders'; //更改
import vGetToolBar from "../Common/GetToolBar";
import vAccountOpen from "../Common/AccountOpen";
import vCUSTOpen from "../Common/CUSTOpen";
import vPRDTOpen from "../Common/PRDTOpen";
import vFormOpen from "../Common/FormOpen";
import vFormOpen1 from "../Common/FormOpen";
export default {

 props: {
    inputName: String,
    required: true,
  },

    data(){
         //表单查询一般分为input，下拉框，和日期，下面是下拉框时的设置下拉信息的情况，我的项目没有用到，但是留着方便看
      
        return {
        tableData:[],//表格数据
        FormData:[],//表格数据
          FormDataPro:[],//表格数据
        FormCols:[],//表头数据
        tableCols:[],//表格列数据
         tableColsPro:[],//表格列数据
        rows:[],
        StepSN: -1,
        WFStepSN:'0',
        billID:null,
        ListLog: [],
        IsfunEdit:false,
       
        Search: {
        // 查询条件
        total: 0, // 总记录数
        pageSize: 13, // 一页显示的记录数
        page: 1, // /当前页码
        RNO: "001", // 表编号  根据Controller中对应的表编号 //更改
        jsWhere: "", // 自定义条件
       
      }, rules: {
        UserName: [
          { required: true, message: "请输入推荐人称", trigger: "blur" },
        ],
      },SearchData: {
        // 查询条件
        total: 0, // 总记录数
        pageSize: 13, // 一页显示的记录数
        page: 1, // /当前页码
        RNO: "378", // 表编号  根据Controller中对应的表编号 //更改
        jsWhere: " and isnull(Status,0)=2 and NotPOQty>0", // 自定义条件
       
      },SearchDataPro: {
        // 查询条件
        total: 0, // 总记录数
        pageSize: 13, // 一页显示的记录数
        page: 1, // /当前页码
        RNO: "1576", // 表编号  根据Controller中对应的表编号 //更改
        jsWhere: " ", // 自定义条件
       
      },
       
       cities: [
        {
          value: "0",
          label: "草稿",
        },
        {
          value: "1",
          label: "审核中",
        },
        {
          value: "2",
          label: "结案",
        },
        {
          value: "3",
          label: "作废",
        },
      ],
       SearchDialog: false,
         DialogBtnMargin: 0,
         dialogVisible: false,
         dialogFormVisible: false,
         dialogCUSTVisible:false,
         dialogPRDTVisible:false,
         dialogFormOpen:false,
         dialogFormOpenPro:false,
         ParmType: "",
         ParmName:"",
          index:0
          
        }
    },

   components:{ //引入组件后注册组件
    cesTable, 
     SearchForm,
     MianForm,
     vAccountOpen,
     vCUSTOpen,
     vPRDTOpen,
     vFormOpen,
       vFormOpen1
   },
   mounted(){

     this.getTableCols()
     this.getDataList()
    
    
   },
    methods:{
        
    
      //读取列配置
        async getTableCols(){
        this.tableCols = [];
        this.FormCols=[];

        const resCols = await  GetFormColsData({InterID:"391"}); //更改
        this.FormCols=resCols.data;


        const res = await  GetTableColsData({InterID:"392"}); //更改
        this.tableCols=res.data;

       const ress = await  GetTableColsData({InterID:"1568"}); //更改
        this.tableColsPro=ress.data;
        
                  
         },
        async getDataList() {

 
 

       if (this.inputName == null) {
        this.inputName = this.$route.query.billID;
      }
;
      const result = await UpdateForm({
        billID: this.inputName,
        IsPostBack: false,
      });

      this.FormData = result.data1.Table[0];
     
      this.tableData = result.data2.Table[0];

      this.FormDataPro = result.data3.Table;
    
      this.ListLog = result.ListLog;
      this.StepSN = result.StepSN;
      
        
        
    
    },OpenFindForm() {
      //打开搜索框
      this.SearchDialog = true;
      //计算外边距
      console.log(this.$refs.searchDialog.offsetHeight);
      this.DialogBtnMargin = this.$refs.searchDialog.offsetHeight - 40;
    },async confirmData(submit) {
      // 提交数据，需要修改

      const Fresult = true;


// if(this.FormData.POrderNo==""||this.FormData.POrderNo==null)
//     {
//        this.$notify({
//               title: "不能保存",
//               dangerouslyUseHTMLString: true,
//               message: "订单号没有保存，不能提交",
//               type: "error",
//             });
//             Fresult = false;
//             return false;

//     }

     if (submit == 1||submit == 2) {

       

        let flag = this.$refs['refFormData'].validateForm(); 



        let flag1 = this.$refs['reftableData'].validateForm(); 

           let flag3= this.$refs['reftableDataPro'].validateForm(); 
  

    if(flag==false||flag1==false||flag3==false)
     {
          this.$notify({
              title: "不能提交",
              dangerouslyUseHTMLString: true,
              message: "不可为空，不能提交",
              type: "error",
            });
            Fresult = false;
            return false;

      }

    if(this.tableData.length<=0)
    {
       this.$notify({
              title: "不能提交",
              dangerouslyUseHTMLString: true,
              message: "行没有数据，不能提交",
              type: "error",
            });
            Fresult = false;
            return false;

    }

   }

  let options="保存中...";

if(submit == 1)
{
  options="提交中...";
}else if(submit == 2)
{
   options="审批中...";
}else if(submit == 3)
{
   options="退回中...";
}

  const loading = this.$loading({
          lock: true,
          text: options,
          spinner: 'el-icon-loading',
          background: 'rgba(0, 0, 0, 0.7)'
        });

      if (Fresult) {
        const result = await UpdateForm({
          HeadDate: JSON.stringify(this.FormData),
          BodyDate: JSON.stringify(this.tableData),
            BodyDatePro: JSON.stringify(this.FormDataPro),
          billID: this.FormData.POrder,
          IsPostBack: true,
          submit: submit,
        });
       loading.close();



        this.FormData = result.data1.Table[0];
        this.tableData = result.data2.Table[0];
       this.FormDataPro = result.data3.Table;
        this.ListLog = result.ListLog;
        this.StepSN = result.StepSN;
        if (result.code === 20000) {
         
          this.dialogVisible = false;
          this.$notify({
            title: result.msg,
            dangerouslyUseHTMLString: true,
            message: "",
            type: "success",
          });
        
          this.$router.push({
        path: "/MesPo/PoOrdersForm",
        query: { billID: this.FormData.POrder, IsPostBack: false },
      });
        } else {
          this.$notify({
            title: result.msg,
            dangerouslyUseHTMLString: true,
            message: "",
            type: "error",
          });
        }
      }
    },async handleMRPData() {
 
         const result = await MRPData({
          billID: this.FormData.POrderNo,
        });

        if (result.code === 20000) {
        
          this.dialogVisible = false;
          this.$notify({
            title: result.msg,
            dangerouslyUseHTMLString: true,
            message: "",
            type: "success",
          });
        
         
        } else {
          this.$notify({
            title: result.msg,
            dangerouslyUseHTMLString: true,
            message: "",
            type: "error",
          });
        }
    

      },
    handleOpen(name,index)
    {
      
    
      if(name=="SalesmanName")
      {
      this.ParmType = "SalesmanName"; //传入参数
      this.dialogFormVisible = true;
      }else if(name=="CustomerName")
      {
         this.ParmType = "CustomerName"; //传入参数
        this.dialogCUSTVisible = true;
      }else if(name=="PrdName")
      {
this.rows={
          OrderNo: this.tableData[index].OrderNo,
          Extend1: this.tableData[index].CustomerCode,
          Extend2: this.tableData[index].CustomerName,
        
        };

        this.index =index;
        this.ParmType = "PrdName"; //传入参数
        this.dialogPRDTVisible = true;
      }else if(name=="Sales")
      {
        this.ParmName=this.FormData.CustomerCode;
          this.ParmType = "Sales"; //传入参数
        this.dialogFormOpen = true;
      }else if(name=="Pro")
      {
          this.ParmType = "Pro"; //传入参数
        this.dialogFormOpenPro = true;

      }

    },
    FunrRowsAdd: function (Rows, ParmType,index) {
      //添加人员

      this.multipleTable = Rows[0];
      let i=0;
      if (ParmType == "SalesmanName") {
        this.FormData.Salesman = this.multipleTable.UserCode;
        this.FormData.SalesmanName = this.multipleTable.UserName;
        this.dialogFormVisible = false;
      }else if (ParmType == "CustomerName") {
        this.FormData.CustomerCode = this.multipleTable.CUS_NO;
        this.FormData.CustomerName = this.multipleTable.NAME;
         this.dialogCUSTVisible = false;
      }else if(ParmType == "PrdName")
      {


         for (let v of Rows) {

        this.multipleTable = v;


      if(i>0)
      {
        this.tableData.push(this.rows);
     
      }
   this.tableData[index].PrdNo=this.multipleTable.PrdNo;
     this.tableData[index].PrdName=this.multipleTable.PrdName;
     this.tableData[index].SPC=this.multipleTable.SPC;
     this.tableData[index].UT=this.multipleTable.UT;

     if(Rows.length==1)
      {
         this.tableData.push(this.rows);
          this.tableData.splice(index+1, 1);
      }
     index++;
     i++;
     }
      this.$forceUpdate();
  
      this.dialogPRDTVisible = false;
      }else if(ParmType == "Sales")
      {
        
 this.multipleTable = Rows[0];
   this.tableData.OrderNo = this.multipleTable.OrderNo;
    this.tableData.OrderID = this.multipleTable.OrderID;
    this.tableData.PrdNo = this.multipleTable.PrdNo;
    this.tableData.PrdName = this.multipleTable.PrdName;
    this.tableData.SPC = this.multipleTable.SPC;
    this.tableData.UT = this.multipleTable.UT;
    this.tableData.Qty = this.multipleTable.NotPOQty;
    this.tableData.InspectionMethod = this.multipleTable.InspectionMethod;
    this.tableData.Certification = this.multipleTable.Certification;
     this.tableData.DeliveryDate = this.multipleTable.DeliveryDate;
      this.tableData.ProductModel = this.multipleTable.ProductModel;
        this.tableData.Extend18 = this.multipleTable.CustomerCode;
    
  //       for (let v of Rows) {

  //    //判断重复不能添加
  //    let Isjudge =  this.tableData.filter(function (item) {
	// 	            if(item.OrderID == v.OrderID){
	// 	                return item;
	// 	            }
	// 	        })
     
     

    

  //  if(Isjudge.length==0)
  //  {
  //       this.multipleTable = v;
  //       let row = {
  //         OrderNo: this.multipleTable.OrderNo,
  //         OrderID: this.multipleTable.OrderID,
  //         PrdNo:this.multipleTable.PrdNo,
  //         PrdName:this.multipleTable.PrdName,
  //         SPC:this.multipleTable.SPC,
  //         UT:this.multipleTable.UT,
  //         Qty:this.multipleTable.NotPOQty

        
  //       };
  //       this.tableData.push(row);
      
  //  }
        
  //    }
      this.$forceUpdate();
      this.dialogFormOpen = false;
      } else if(ParmType == "Pro")
      {


                 for (let v of Rows) {

     //判断重复不能添加
     let Isjudge =  this.FormDataPro.filter(function (item) {
		            if(item.volume_upCode == v.volume_upCode){
		                return item;
		            }
		        })
     
     

    

   if(Isjudge.length==0)
   {
        this.multipleTable = v;
        let row = {
          volume_upCode: this.multipleTable.volume_upCode,
          volume_upName: this.multipleTable.volume_upName,
           MakerDep: this.multipleTable.MakerDep,
           Price: this.multipleTable.Price
        

        
        };
        this.FormDataPro.push(row);
      
   }
        
     }
      this.$forceUpdate();
  
      this.dialogFormOpenPro = false;
      }
      
    
     
    }, async handleEdit() {
      // 修改

       let routeUrl = this.$router.push({
        path: "/MesSales/SalesBomForm",//更改
        query: { billID: this.FormData.POrderNo, ProductNo:this.tableData.PrdNo, IsPostBack: false },
      });
      window.open(routeUrl.href, "_top");

     
   
      
    },
    handleClose()
    {
       this.$store.dispatch('tagsView/delView', this.$route)
// 返回上一步路由
      this.$router.go(-1)
 
    },handleAdd()
    {
      this.inputName="";
      this.$route.query.billID="";
      this.getDataList();

    },handleCopy()
    {
this.StepSN = 0;
    this.inputName="";
    this.$route.query.billID="";
   this.tableData.POrderNo = null;
   this.FormData.POrderNo = null;
   this.tableData.OrderNo = null;
    this.tableData.OrderID =null
    this.tableData.PrdNo = null;
    this.tableData.PrdName = null;
    this.tableData.POrder = null;
   this.tableData.Qty = null;
   this.tableData.InQty = null;
   this.tableData.POQty = null;
    this.tableData.PlantQty = null;
     this.tableData.OutwhQty = null;
       this.tableData.CountQty = null;
       this.tableData.IsSendPOQty = null;
   this.tableData.ID = null;
   this.tableData.IsBom = null;
   this.FormData.POrder = null;
   this.FormData.BillState = null;
   this.FormData.Status = null;
   this.FormData.WorkFlowInstanceID = null;

    },delData({ $index, row }) {

      
      
    

     this.$confirm('删除操作, 是否继续?', '提示', {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
      })
        .then(async () => {
         
           
            this.FormDataPro.splice($index, 1);
           


            if (row.ID == null) { //更改
              return false;
            }

            const result = await DeleteRow({
              ID: row.ID,
              billID: this.inputName,
              types: 1,
              IsPostBack: false,
            });

            this.$message({
              type: "success",
              message: result.msg,
            });
          
        })
        .catch((err) => {
          console.error(err);
        });
    },
    async PrintDate () 
    {
      // 提交数据，需要修改

      var PrintDates=[];
      let PrintData =  this.FormDataPro.filter(function (item) {
          
          // if(item.SourceID == SourceID){
          //     return item;
          //  }

          return item;
      })

      var TotalNum=20-PrintData.length;
     for (var k = 0; k < TotalNum; k++) 
      {

        let rowo={
          volume_upName:null,
          ProceQty:null,
          Scale:null,

};

        PrintData.push(rowo);

      }

    
   
if(PrintData.length>0)
{
    var ProceQty=0;
 
    var SPC="";
    var SubtotalProceQty=0;
    var TotalProceQty=0
    var Num=10;
    var i=0;
    var j=0;
     let row={};
// 提交数据，需要修改
for (let v of PrintData)
{
   i++;   
   j++; 
  
   SPC=v.SPC;

   

if(i<=Num)
{
 

  if(i==9)
  {
   
    var ss="";
  }

  if(i<=Num)
{

 
row={
Sort0:i,
MakerDep:v.MakerDep,
volume_upName:v.volume_upName,
ProceQty:v.ProceQty,
Scale:v.Scale,
Sort1:null,
MakerDep1:v.MakerDep,
volume_upName1:null,
ProceQty1:null,
Scale1:null,
Sort2:null,
MakerDep2:v.MakerDep,
volume_upName2:null,
ProceQty2:null,
Scale2:null,

};
 PrintDates.push(row);
}
  if(i==Num) {
//     row={
// Sort0:'小计',
// TotalProceQty:SubtotalProceQty,
// Weight:SubtotalTareWeight,
// TareWeight:SubTotalProceQty,
// Sort1:null,
// TotalProceQty1:null,
// Weight1:null,
// TareWeight1:null,
// Sort2:null,
// TotalProceQty2:null,
// Weight2:null,
// TareWeight2:null,

// };

//      SubtotalProceQty=0;
//      SubtotalTareWeight=0;
//      SubTotalProceQty=0;
     j=0;
   
// PrintDates.push(row);
 continue;
}



 

}else if(i>Num&& i<=Num*2)
{
  if(i<=Num*2)
  {
     
  PrintDates[j-1]["Sort1"]=i;
  PrintDates[j-1]["MakerDep1"]=v.MakerDep;
  PrintDates[j-1]["volume_upName1"]=v.volume_upName;
  PrintDates[j-1]["ProceQty1"]=v.ProceQty;
  PrintDates[j-1]["Scale1"]=v.Scale;

  }
   if(i==Num*2)
   {
  // PrintDates[j]["Sort1"]="小计";
  // PrintDates[j]["ProceQty1"]=v.TotalProceQty;
  // PrintDates[j]["Weight1"]=v.Weight;
  // PrintDates[j]["TareWeight1"]=v.TareWeight;

  // SubtotalProceQty=0;
  //    SubtotalTareWeight=0;
  //    SubTotalProceQty=0;
     j=0;
      continue;

   }

  // }else if(i>Num*2&& i<=Num*3)
  // {
  //    ;

  //   if(i<=Num*3)
  // {
  //   PrintDates[j-1]["Sort2"]=i;
  // PrintDates[j-1]["volume_upName2"]=v.volume_upName;
  // PrintDates[j-1]["ProceQty2"]=v.ProceQty;
  // PrintDates[j-1]["Scale2"]=v.Scale;


  // }
  // if(i==Num*3)
  // {
  //    ;
  // PrintDates[j]["Sort2"]="小计";
  // PrintDates[j]["TotalProceQty2"]=SubtotalProceQty;
  // PrintDates[j]["Weight2"]=SubtotalTareWeight;
  // PrintDates[j]["TareWeight2"]=SubTotalProceQty;

  // SubtotalProceQty=0;
  //    SubtotalTareWeight=0;
  //    SubTotalProceQty=0;
  //    j=0;
  //      continue;

  // }
 

}







}


// let rows = {
//     TotalProceQty: TotalProceQty,
//     TareWeight: TareWeight,
//     SPC: SPC,
//     Weight: Weight
 
//   };




await PrintDate('T20231008001',this.tableData,PrintDates,2);
}else
{
this.$notify({
      title: "没有数据，不能打印",
      dangerouslyUseHTMLString: true,
      message: "",
      type: "error",
    });
}






     //await PrintDate('T20231008001',this.tableData,this.FormDataPro,2);
    
      
    
    },
        
  }
}
</script>

<style lang="scss" scoped>

.app-container {
  .EditObjs-table {
    margin-top: 30px;
  }

  .permission-tree {
   margin-bottom: 0px
  }
}
.searchDialog ::v-deep .el-dialog__header {
  background: #409eff;
}
.searchDialog ::v-deep .el-dialog__title {
  color: #fff;
}
.searchDialog ::v-deep .el-dialog__headerbtn .el-dialog__close {
  color: #fff;
}
.infoColor {
  font-weight: bold;
  color: #909399;
}
.redColor {
  font-weight: bold;
  color: red;
}
.blueColor {
  font-weight: bold;
  color: #409eff;
}
.orangeColor {
  font-weight: bold;
  color: orange;
}
.greenColor {
  font-weight: bold;
  color: #67c23a;
}
</style>